<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<input type="hidden" name="zh_parsen/fzr_name" value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/zh_name"/>" />
<input type="hidden" name="zh_parsen/fzr_mobile" value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/mobile"/>" />
<input type="hidden" name="zh_parsen/fzr_tel" value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/tel_work"/>" />
<input type="hidden" name="zh_parsen/fzr_email" value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/email"/>" />
<div class="t_bar">
<x:parse xml="${param.xmlstr}" var="xmlData" />
<span class="color_red">*</span>
	项目基本情况
</div>
<table class="table01 t_css" width="100%" border="0" cellpadding="0" id="basicinfo_tb" cellspacing="1">
	<col style="width: 20%" />
	<col style="width: 30%" />
	<col style="width: 20%" />
	<col style="width: 20%" />
	<col style="width: 20%" />
	<tr >
		<td align="right" >平台名称：</td>
		<td colspan="4">
			<input type='text' name='proposal/zh_title' id='zh_title' style="width: 76%" class="input_css required" maxlength="100" value='<x:out select="$xmlData/data/proposal/zh_title"/>' label="平台名称">
		</td>	
	</tr>
	
	<tr >
		<td align="right">归口管理部门：</td>
		<td>
			<c:set var="recomend_org">{'id':'<x:out select="$xmlData/data/proposal/recomend_org_value" />','name':'<x:out select="$xmlData/data/proposal/recomend_org_name" />'}</c:set>
			<cpt:tree key="recomend_org_gk" cacheable="false" readonly="true" className="hn_iuput_kuang " id="recomend_org" value="${recomend_org}" label="归口管理部门"   showPattern="all" shieldPattern="-1"
					  onClick="initTreeValueExt" />
			<input type="hidden" id="recomend_org_value" name="proposal/recomend_org_value" class="required" value="<x:out select="$xmlData/data/proposal/recomend_org_value" />" label="归口管理部门">
			<input type="hidden" name="proposal/recomend_org_name" value="<x:out select="$xmlData/data/proposal/recomend_org_name" />">
		</td>
		<td align="right">申报日期：</td>
		<td colspan="2">
			<c:set var="submit_date">
				<x:out select="$xmlData/data/proposal/submit_date" />
			</c:set>
			<cpt:date id="submit_date" size="12" name="proposal/submit_date" value="${submit_date}" className=" required date " label="申报日期"></cpt:date>
		</td>
	</tr>
	
	<tr >
		
		<td align="right">主管处室：</td>
		<td >
			<span name="proposal/default_admin_org_name"><x:out select="$xmlData/data/proposal/admin_org_name" /></span>
		</td>
		<td align="right"></td>
		<td colspan="2">
		</td>
	</tr>
	
	<tr >
		<td align="right">批准时间：</td>
		<td>
			<c:set var="build_time"><x:out select="$xmlData/data/proposal/build_time" /></c:set>
			<cpt:date id="build_time" size="12" name="proposal/build_time" value="${build_time }" className="required date " label="批准时间" ></cpt:date>
		</td>
		<td align="right">验收时间：</td>
		<td colspan="2">
		<c:set var="acceptance_time"><x:out select="$xmlData/data/proposal/acceptance_time" /></c:set>
		<cpt:date id="acceptance_time" size="12" name="proposal/acceptance_time" value="${acceptance_time }" className="required date dateCompareBeforeE:build_time:acceptance_time" label="验收时间" ></cpt:date>
		</td>
	</tr>
	
	<tr >
		<td align="right">实际科研场地面积<br />（平方米）：</td>
		<td>
			<input type="text" class="required" style="text-align: right;" name="proposal/office_space" id="office_space"
			value="<x:out select="$xmlData/data/proposal/office_space" />" label="实际科研场地面积" onfocus="InitInput.setNumber(this,9,2,2)" />
		</td>
		<td align="right">单位研发仪器和设备原值<br />（万元）：</td>
		<td colspan="2">
			<input type="text" class="required" style="text-align: right;" name="proposal/turnover" id="turnover" 
			value="<x:out select="$xmlData/data/proposal/turnover" />" label="单位研发仪器和设备原值" onfocus="InitInput.setNumber(this,9,2,2)" />	
		</td>
	</tr>
	
	<tr >
		<td align="right">固定人员数：</td>
		<td>
			<input type="text" class="required valueGreatEqual:person_num:act_person" style="text-align: right;" name="proposal/person_num" id="person_num"
			value="<x:out select="$xmlData/data/proposal/person_num" />" label="固定人员数" onfocus="InitInput.setNumber(this,9,0,0)" />
		</td>
		<td align="right">其中：从事研发活动人员</td>
		<td colspan="2">
			<input type="text" class="required" style="text-align: right;" name="proposal/act_person" id="act_person" 
			value="<x:out select="$xmlData/data/proposal/act_person" />" label="其中：从事研发活动人员" onfocus="InitInput.setNumber(this,9,0,0)" />	
		</td>
	</tr>
	

	<tr >
		<td align="right">项目申请金额（万元）：</td>
		<td >
			<input type='text' name='proposal/request_amt' class="required" id='request_amt' onfocus="InitInput.setNumber(this,9,2,2)" style="text-align: right;"
				   onchange="synchronizationAmount();"	value='<x:out select="$xmlData/data/proposal/request_amt"/>' label="项目申请金额">
		</td>
	
		<td align="right">
			项目报审级次：
			<br />
			（省补助资金拨付所属财政局）
		</td>
		<td colspan="2">
			<c:set var="sub_step">{'id':'<x:out select="$xmlData/data/proposal/sub_step_value" />','name':'<x:out select="$xmlData/data/proposal/sub_step_name" />'}</c:set>
			<cpt:tree key="sub_step" cacheable="false" className="hn_iuput_kuang  " readonly="true" value="${sub_step}" label="项目报审级次" id="sub_step" onlyChooseLeaf="false" showPattern="all"
					  shieldPattern="0" topCheckbox="true" onClick="initTreeValueExt" />
			<input id="sub_step_value" type="hidden" name="proposal/sub_step_value" class="required" label="项目报审级次" value="<x:out select="$xmlData/data/proposal/sub_step_value" />" />
			<input id="sub_step_name" type="hidden" name="proposal/sub_step_name" value="<x:out select="$xmlData/data/proposal/sub_step_name" />" />
		</td>
	</tr>
	
	<tr>
		<td align="right" >项目负责人姓名：</td>
		<td  > 
		    <span name="proposal/fzr_psnname" ><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/zh_name" /></span>
		</td>
		<td align="right" >手机号码：</td>
		<td colspan="2"> 
		    <span name="proposal/fzr_mobile" ><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/mobile" /></span>
		</td>
	</tr>
	
	<tr>
		<td align="right" >电子邮箱：</td>
		<td> 
		    <span name="proposal/fzr_email" ><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/email" /></span>
		</td>
		<td align="right" >联系电话：</td>
		<td colspan="2"> 
		    <span name="proposal/fzr_tel" ><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/tel_work" /></span>
		</td>
	</tr>
	
	<tr>
		<td align="right" >是否规上企业：</td>
		<td > 
      <%--   <c:set var="plan_value"><x:out select="$xmlData/data/proposal/plan_value" /></c:set> 
		<cpt:select id="plan" key="boolean"  value="${plan_value}" className="required" label="是否已纳入深圳市城市更新单元规划制定计划"></cpt:select>
		<input type="hidden"  name="proposal/plan_value" value="${plan_value}" />
		<input type="hidden" name="proposal/plan_name" value="<x:out select="$xmlData/data/proposal/plan_name" />" /> --%>
		
		<c:set var="plan_value"><x:out select="$xmlData/data/proposal/plan_value" /></c:set>
		<cpt:checkbox key="boolean" name="proposal/plan" value="${plan_value }" tagType="radio" repeatColumn="2" width="40px;"></cpt:checkbox>
		<input type="hidden" id="plan_value" name="proposal/plan_value" label="是否规上企业" class="required"  value="<x:out select="$xmlData/data/proposal/plan_value" />" />
		<input type="hidden" id="plan_name" name="proposal/plan_name" value="<x:out select="$xmlData/data/proposal/plan_name" />" />
		</td>
		<td colspan="3"> 
	</tr>
	<tr>
		<td align="right">项目简介（限300字）：</td>
		<td colspan="4">
			<textarea name="proposal/project_description" style="width:98%;outline:none;resize:none;" class="input_textarea required maxlength:300"  label="项目简介"   rows = "10" cols = "60" ><x:out select="$xmlData/data/proposal/project_description" /></textarea>
			<input type="hidden" name="proposal/project_description_hidden" value="<x:out select="$xmlData/data/proposal/project_description_hidden" />"/>
		</td>
	</tr>
</table>
<c:set var="nature_value">${param.nature_value}</c:set>
<c:choose>
	<c:when test="${fn:contains(nature_value,'A')}">
<div class="t_bar">
	单位近三年开展的产学研合作情况（不超过三家）
</div>
<table  id="tblcooperation_situations" cellpadding="0" class="table01 t_css" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;">
	<thead >
	<tr style="border:1px solid #B7D1E6">
		<th class="TblHead" align="center"  width="5%">选择</th>
		<th class="TblHead" align="center"  width="5%">序号</th>
		<th class="TblHead" align="center"  width="30%">合作单位</th>
		<th class="TblHead" align="center"  width="30%">代表项目</th>
		<th class="TblHead" align="center"  width="30%">合作总经费（万元）</th>
	</tr>
	</thead>
	<tbody id="tab">
	<tr style="display:none">
		<td align="center">
			<input type="radio" style="border: 0px;background-color: white;" class="radiobutton" name="selcooperation_situations" >
		</td>
		<td align="center">
			<span name="cooperation_situations|cooperation_situation[0]@seq_no" >[index]</span>
		</td>
		<td align="center">
			<input  id="cooperation_situation_name_[0]" name="cooperation_situations|cooperation_situation[0]|cooperation_situation_name" label="合作单位" maxlength="100" value="" class=" required input_text" style="width:80%"  />
		</td>
		<td align="center">
			<input  id="cooperation_situation_project_[0]" name="cooperation_situations|cooperation_situation[0]|cooperation_situation_project" label="代表项目" maxlength="100" value="" class=" required input_text" style="width:80%"  />
		</td>
		<td align="center">
			<input  id="fee_out_[0]" name="cooperation_situations|cooperation_situation[0]|fee_out" label="合作总经费" value="" onfocus="InitInput.setNumber(this,9,2,2);" class=" required input_text" style="width:80%;text-align: right;"  />
		</td>
	</tr>

	<c:set value="0" var="index" scope="page"/>
	<x:forEach select="$xmlData/data/cooperation_situations/cooperation_situation" var="cooperation_situation">

		<c:choose>
			<c:when test="${index<10}" ><c:set value="0" var="flag" scope="page"/></c:when>
			<c:otherwise><c:set value="" var="flag" scope="page"/></c:otherwise>
		</c:choose>
		<tr >
			<td align="center">
				<input type="radio" style="border: 0px;background-color: white;" class="radiobutton" name="selcooperation_situations" >
			</td>
			<td align="center">
				<span   name="cooperation_situations/cooperation_situation[${flag}${index}]@seq_no" ><x:out select="$cooperation_situation/@seq_no"/></span>
			</td>
			<td align="center">
				<input  id="cooperation_situation_name_[${flag}${index}]" name="cooperation_situations/cooperation_situation[${flag}${index}]/cooperation_situation_name" label="合作单位" maxlength="100" value="<x:out select="$cooperation_situation/cooperation_situation_name"/>" class=" required input_text" style="width:80%"  />
			</td>
			<td align="center">
				<input  id="cooperation_situation_project_[${flag}${index}]" name="cooperation_situations/cooperation_situation[${flag}${index}]/cooperation_situation_project" label="代表项目" maxlength="100" value="<x:out select="$cooperation_situation/cooperation_situation_project"/>" class=" required input_text" style="width:80%"  />
			</td>
			<td align="center">
				<input  id="fee_out_[${flag}${index}]" name="cooperation_situations/cooperation_situation[${flag}${index}]/fee_out" label="合作总经费" value="<x:out select="$cooperation_situation/fee_out"/>" onfocus="InitInput.setNumber(this,9,2,2);" class=" required input_text" style="width:80%;text-align: right;"  />
			</td>
		</tr>
		<c:set value="${index+1}" var="index" scope="page"/>
	</x:forEach>
	</tbody>
</table>
<table id="jbutton" width="98%" align="center" border="0" cellspacing="0" cellpadding="0" style="border:0;">
	<tr ><td>
		<input class="button_02" id="tianjia" name="cmdAddbefore" type=button value="添加" onclick="if(checkTabLimit('tblcooperation_situations',3,'单位近三年开展的产学研合作情况最多只能填写3条')){addNewRow('tblcooperation_situations');showDateTag('tblcooperation_situations');}try{top.resizeFrame();}catch(e){};changeCss('tblcooperation_situations');">
		<input class="button_02" name="cmdMovePrev" type=button value="上移" onclick="movePrev('tblcooperation_situations','selcooperation_situations');changeCss('tblcooperation_situations');">
		<input class="button_02" name="cmdMoveNext" type=button value="下移" onclick="moveNext('tblcooperation_situations','selcooperation_situations');changeCss('tblcooperation_situations');">
		<input class="button_02" name="cmddel" type=button  value="删除" onclick="deleteSelectedRow('tblcooperation_situations','单位近三年开展的产学研合作情况');changeCss('tblcooperation_situations');">
	</td></tr>
</table>
</c:when>
	<c:otherwise>
	
<div class="t_bar">
	上一年承担省部级以上重大科研项目情况（代表性的，数量不超过5项）
</div>
<table  id="tbllast_situations" cellpadding="0" class="table01 t_css" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;">
	<thead >
	<tr style="border:1px solid #B7D1E6">
		<th class="TblHead" align="center"  width="5%">选择</th>
		<th class="TblHead" align="center"  width="5%">序号</th>
		<th class="TblHead" align="center"  width="30%">项目类别</th>
		<th class="TblHead" align="center"  width="30%">项目名称</th>
		<th class="TblHead" align="center"  width="30%">经费（万元）</th>
	</tr>
	</thead>
	<tbody id="tab">
	<tr style="display:none">
		<td align="center">
			<input type="radio" style="border: 0px;background-color: white;" class="radiobutton" name="sellast_situations" >
		</td>
		<td align="center">
			<span name="last_situations|last_situation[0]@seq_no" >[index]</span>
		</td>
		<td align="center">
			<input  id="last_situation_name_[0]" name="last_situations|last_situation[0]|last_situation_name" label="项目类别" maxlength="100" value="" class=" required input_text" style="width:80%"  />
		</td>
		<td align="center">
			<input  id="last_situation_project_[0]" name="last_situations|last_situation[0]|last_situation_project" label="项目名称" maxlength="100" value="" class=" required input_text" style="width:80%"  />
		</td>
		<td align="center">
			<input  id="fee_out_[0]" name="last_situations|last_situation[0]|fee_out" label="经费" value="" onfocus="InitInput.setNumber(this,9,2,2);" class=" required input_text" style="width:80%;text-align: right;"  />
		</td>
	</tr>

	<c:set value="0" var="index" scope="page"/>
	<x:forEach select="$xmlData/data/last_situations/last_situation" var="last_situation">

		<c:choose>
			<c:when test="${index<10}" ><c:set value="0" var="flag" scope="page"/></c:when>
			<c:otherwise><c:set value="" var="flag" scope="page"/></c:otherwise>
		</c:choose>
		<tr >
			<td align="center">
				<input type="radio" style="border: 0px;background-color: white;" class="radiobutton" name="sellast_situations" >
			</td>
			<td align="center">
				<span   name="last_situations/last_situation[${flag}${index}]@seq_no" ><x:out select="$last_situation/@seq_no"/></span>
			</td>
			<td align="center">
				<input  id="last_situation_name_[${flag}${index}]" name="last_situations/last_situation[${flag}${index}]/last_situation_name" label="项目类别" maxlength="100" value="<x:out select="$last_situation/last_situation_name"/>" class=" required input_text" style="width:80%"  />
			</td>
			<td align="center">
				<input  id="last_situation_project_[${flag}${index}]" name="last_situations/last_situation[${flag}${index}]/last_situation_project" label="项目名称" maxlength="100" value="<x:out select="$last_situation/last_situation_project"/>" class=" required input_text" style="width:80%"  />
			</td>
			<td align="center">
				<input  id="fee_out_[${flag}${index}]" name="last_situations/last_situation[${flag}${index}]/fee_out" label="经费" value="<x:out select="$last_situation/fee_out"/>" onfocus="InitInput.setNumber(this,9,2,2);" class=" required input_text" style="width:80%;text-align: right;"  />
			</td>
		</tr>
		<c:set value="${index+1}" var="index" scope="page"/>
	</x:forEach>
	</tbody>
</table>
<table id="jbutton" width="98%" align="center" border="0" cellspacing="0" cellpadding="0" style="border:0;">
	<tr ><td>
		<input class="button_02" id="tianjia" name="cmdAddbefore" type=button value="添加" onclick="if(checkTabLimit('tbllast_situations',5,'上一年承担省部级以上重大科研项目情况最多只能填写5条')){addNewRow('tbllast_situations');showDateTag('tbllast_situations');}try{top.resizeFrame();}catch(e){};changeCss('tbllast_situations');">
		<input class="button_02" name="cmdMovePrev" type=button value="上移" onclick="movePrev('tbllast_situations','sellast_situations');changeCss('tbllast_situations');">
		<input class="button_02" name="cmdMoveNext" type=button value="下移" onclick="moveNext('tbllast_situations','sellast_situations');changeCss('tbllast_situations');">
		<input class="button_02" name="cmddel" type=button  value="删除" onclick="deleteSelectedRow('tbllast_situations','上一年承担省部级以上重大科研项目情况');changeCss('tbllast_situations');">
	</td></tr>
</table>
	</c:otherwise>
</c:choose>


<script type="text/javascript">
function initTreeValueExt(treeId, treeNode) {

	if (!(treeNode && (treeNode.level > 0 || !treeNode.isParent))) {
		scmWarn($("#" + treeId).attr("label") + messageTip.researchAreaInvalidDisciplineCode);
		if (treeNode.level == 0) {
			$("#" + treeId).val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId+ "_code']").val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId+ "_value']").val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId+ "_name']").val("");
		}

		return false;
	}


	var str = treeNode.name;
	var obj = treeNode.parentNode;
	while (obj != null) {
		obj = obj.parentNode;
	}

	$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId+ "_code']").val(treeNode.id);
	$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId+ "_value']").val(treeNode.id);
	$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId+ "_name']").val(str);

}
	function changeCss(id) {
	    $("#"+id+">tbody>tr:odd").each(function(){
	        $(this).removeClass().addClass("li_1");
	    });
	    $("#"+id+">tbody>tr:even").each(function(){
	        $(this).removeClass().addClass("li_2");
	    });
	}
	
	
</script>
